home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-05-08 | 6.9 KB | 180 lines | [ttro/ttxt] |
- ______________________________________________________________________
- VU Aid ReadMe (1.0.8)
-
- ______________________________________________________________________
- WHAT'S NEW TO THIS RELEASE
-
- New WindowCompare and ScreenCompare modules! WindowCompare
- allows checksumming of the frontmost window as well as a portion of the window.
- Similarly for ScreenCompare allows checksumming of the main screen and any
- smaller portion defined by the user. These updated modules must be used in
- invisible mode (see below) in order to work correctly.
-
- ______________________________________________________________________
- WHAT IT IS
-
- VUAid is a collection of code modules which return information about the
- CPU. These code modules act as a supplement to Virtual User, and are called
- within VU scripts using the "VUAidLib.vu" library tasks.
-
- ______________________________________________________________________
- INSTALLATION
-
- To use VUAid, launch the "VUAid Installer" application on your target CPU. Then
- select Install VUAid menu item. If the installation is successful, a dialog appears
- with a 'successful installation' message.
-
- ______________________________________________________________________
- OPERATING VUAID
-
- VUAid is installed as FKEY zero. To operate it, you (or your script) will
- press shift-command-zero. Then you will type a command, followed by a list
- of parameters. Parameters are separated by spaces. To include spaces within
- a parameter, surround it with double quotes ("). To include a double quote
- within a quoted parameter, double the double quote.
-
- Example: "here->""<-it is" will be parsed as the string “here->"<-it is”.
-
- ______________________________________________________________________
- INVISIBLE MODE
-
- At times, you may wish to operate VUAid invisibly. Examples are for VCMDs
- which checksum the front window, or do other screen operations.
-
- To enter invisible mode, press the caps lock key before you invoke VUAid.
-
- VUAid will work just as before in invisible mode, but will not alter
- the screen contents. The special keys return, enter, command-Q, and
- command-period all behave as before. The delete key behaves differently in
- invisible mode: It deletes everything that has been entered so far, rather
- than only the last character.
-
- Since VUAid is usually run from a VU script, the lack of visual feedback
- should be ok.
-
- ______________________________________________________________________
- INSTALLED MODULES
-
- To see which modules are installed, type "Help" in the VUAid window and
- press the Execute button.
-
- ______________________________________________________________________
- FORMAT OF MODULES
-
- Any code module which returns a value may be bundled into VUAid. To submit
- a code module for inclusion, the code module must satisfy the following:
-
- 1. It must be written in MPW C, and submitted as a folder with all source
- code and include files. The folder should include a make file which contains
- all build commands to build the code resource.
-
- 2. It must reside within a single code segment.
-
- 3. It may not use any A5 world storage. This includes static local variables
- as well as global variables
-
- 4. It should not allocate any permanent space on the heap, although it may
- temporarily allocate memory, as long as disposes of all storage before
- returning. (See below for exceptions.)
-
- 5. It may not alter the environment in any way, except in those ways which
- are specific to the function of the command. So a module whose function is
- to set a byte of memory may alter a single memory, but should not change the
- current GrafPort.
-
- 6. The entry point must be a single function which returns a value. This
- value may be a numeric value (char, short, or long), or a string (char * or
- StringPtr). If necessary, a structure may be returned, although this is
- undesirable.
-
- 7. The code must not call any manager initialization functions, such as
- InitDialogs().
-
- MODULE DECLARATION
-
- Modules are called using a command line syntax. For instance, one command
- may set a word of memory. It will be invoked with the command line:
-
- sw 0 1024
-
- VUAid will parse this line before passing dispatching to the module. It
- will set up the following parameter tables:
-
- argc = 2
-
- argv[0] = "\p0 1024"
- argv[1] = "\p0"
- argv[2] = "\p1024"
-
- argn[1] = 0
- argn[2] = 1024
-
- The parameters are:
-
- {argc} is the number of parameters, excluding the name of the module.
-
- {argv[]} is a table of StringPtr's. {argv[i]} contains the text of the
- i-th parameter, where i=1 is the first parameter. {argv[0]} is a special
- entry which contains a string will all the parameters, unparsed. This is
- useful if you wish to use unparsed parameters or to parse the parameters
- yourself. {argv[i]} where i > {argc} has an undefined value.
-
- {argn[]} is a table of long numbers (32 bits). These are the values of
- the corresponding {argv[]} entries, as given by StringToNum(). Note that
- {argn[0]} has an undefined value. {argn[i]} where i > {argc} also has an
- undefined value.
-
- Modules are stand-alone code resources. The entry point is the start of
- the code resource. The resource type is 'vcmd'. The main entry should be
- declared:
-
- OSErr main(StringPtr result, short argc, StringPtr *argv, long *argn);
-
- Parameters here are:
-
- {result} is the string result to be returned, if any. It points to a
- Str255 allocated by the caller (you do not need to allocate space for
- it). If a numeric value is to be returned, it must be converted to a
- string (e.g., using NumToString()). If no result is to be returned,
- {result} should remain untouched. DO NOT RETURN ERROR RESULTS IN
- {result}. Indicate errors using the return value, as noted below.
-
- {argc}, {argv}, and {argn} are described above. Note that the latter
- two parameters are pointers to tables of StringPtrs and longs,
- respectively.
-
- The return value should be an OSErr. It should be noErr (zero) if the
- module executes successfully, the appropriate OSErr if one occurs, or
- the special value 1 if there is an error in the parameters. For example,
- the 'sw' module expects two parameters. The first must be an even
- value. The second must be a word. The module should check all its
- parameters first, and return an error of 1 if any are incorrect.
-
- Example: The following is the code for the 'sw' module. Note that it also
- checks to see that the memory was set as expected. If not, it returns an
- error code of -1.
-
- OSErr main(StringPtr result, short argc, StringPtr *argv, long *argn)
-
- /*
- Set the contents of a word. We require exactly one parameter. If it
- is an odd address, or if the data is too large for a word, we return
- a parameter error. If the memory is not set, we return a -1 error.
- */
-
- {
- if (argc != 2 || argn[1] & 1 || argn[2] & 0xFFFF0000) return 1;
- else {
- short *p = (short*)(argn[1]);
- *p = argn[2];
- return (*p == argn[2]) ? noErr: -1;
- }
- }
-
- EXAMPLES
-
- See the Example Module folder for an example of a module with source code
- and make file.
-
- EOF
-